package com.tenwives.ashop.kernel;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;

import java.util.function.Function;

/**
 * 折扣：总价、单品
 */
@AllArgsConstructor
@ToString
@Data
public class Discount implements Function<Double, Double> {
    String name;
    double discount;

    @Override
    public Double apply(Double aDouble) {
        return aDouble * discount;
    }
}
